package br.com.dev.tcc.view.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;
import android.widget.TextView;
import br.com.dev.tcc.R;

public class ErrorDialog extends Dialog {

	public ErrorDialog(Context context, int messageResId) {
		this(context, context.getString(messageResId));
	}
	
	public ErrorDialog(Context context, String message) {
		
		super(context, R.style.DialogAppTheme);

		super.getWindow();
		super.requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.setContentView(R.layout.error_dialog);
		
		findViewById(R.id.btOk).setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				dismiss();
			}
		});
		
		((TextView) findViewById(R.id.message)).setText(message);
	}
}
